package com.xwh.week5;

public class Pr_6 {
    public static void main(String[] args) {
        System.out.println(num());
    }

    public static int num() {
        int t;
        for (int n = 34; ; n++) {
            if (n % 2 != 0 && noPrime(n)) {
                int j;
                for (j = 3; j < n; j++) {
                    if (noPrime(j) == false && j % 2 == 1) {
                        t = (int) Math.sqrt((n - j) / 2);
                        if (t * t == (n - j) / 2) break;
                    }
                }
                if (j == n) return n;
            }
        }
    }

    public static boolean noPrime(int n) {
        for (int i = 2; i <= Math.sqrt(n); i++)
            if (n % i == 0) return true;
        return false;
    }
}
